<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>DSF2FLAC: DsdDecimator Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">DSF2FLAC
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">DsdDecimator Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="DsdDecimator" -->
<p>The <a class="el" href="classDsdDecimator.html" title="The DsdDecimator reads DSD samples from a DsdSampleReader and converts them to PCM samples...">DsdDecimator</a> reads DSD samples from a <a class="el" href="classDsdSampleReader.html" title="Abstract class defining anything which reads dsd samples from something.">DsdSampleReader</a> and converts them to PCM samples.  
 <a href="classDsdDecimator.html#details">More...</a></p>

<p><code>#include &lt;dsd_decimator.h&gt;</code></p>

<p><a href="classDsdDecimator-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a3dd1c51417cfe3824fabe905c9ebaaf4">DsdDecimator</a> (<a class="el" href="classDsdSampleReader.html">DsdSampleReader</a> *reader, dsf2flac_uint32 outputSampleRate)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class constructor.  <a href="#a3dd1c51417cfe3824fabe905c9ebaaf4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a54a6576a455fcc80cf6e564efeaa5c78">~DsdDecimator</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class destructor, frees internal buffers and lookup table.  <a href="#a54a6576a455fcc80cf6e564efeaa5c78"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a26dde074bfd44b1f67d6e06c3ef75e91">isValid</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return false if the reader is invalid (format/file error for example).  <a href="#a26dde074bfd44b1f67d6e06c3ef75e91"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a2abbd00ca884cec25b6ff0a75b2b44c7">getErrorMsg</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a message explaining why the reader is invalid.  <a href="#a2abbd00ca884cec25b6ff0a75b2b44c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_uint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a18dece3aee46e8fe3263355b4abb8a2b">getOutputSampleRate</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the output sample rate in Hz.  <a href="#a18dece3aee46e8fe3263355b4abb8a2b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_uint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#aff626833b1aed5d926d45697fa5267de">getDecimationRatio</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the decimation ratio: DSD sample rate / PCM sample rate.  <a href="#aff626833b1aed5d926d45697fa5267de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_int64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#ae0aa44ed62ef6f7de292a15ff0d08b80">getLength</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the data length in PCM samples.  <a href="#ae0aa44ed62ef6f7de292a15ff0d08b80"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_uint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#adcf732aee99437f833e174b8ea787aac">getNumChannels</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of channels if audio data.  <a href="#adcf732aee99437f833e174b8ea787aac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_float64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#aa550fbc6c01104d80b169c56ded63366">getPosition</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current position in PCM samples.  <a href="#aa550fbc6c01104d80b169c56ded63366"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_float64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a340371e374a0f18fd65a49df244008eb">getPositionInSeconds</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current position in seconds.  <a href="#a340371e374a0f18fd65a49df244008eb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_float64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a00cd0797502642d272b8ca75cab0d106">getPositionAsPercent</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the current position as a percent of the total data length.  <a href="#a00cd0797502642d272b8ca75cab0d106"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_float64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a257af5321095b2722ed35722253657c7">getFirstValidSample</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the position of the first PCM sample that is completely defined.  <a href="#a257af5321095b2722ed35722253657c7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsf2flac_float64&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a04549fd1787ba5c1ffc9ad1b06a44ba5">getLastValidSample</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the position of the last PCM sample that is completely defined.  <a href="#a04549fd1787ba5c1ffc9ad1b06a44ba5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#ab372f3f22c9ef19d861274e35bb21b95">step</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Steps the decimator forward by 8 DSD samples.  <a href="#ab372f3f22c9ef19d861274e35bb21b95"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename sampleType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#ad04d2cc2a50accf01944d1b9b1e779b0">getSamples</a> (sampleType *buffer, dsf2flac_uint32 bufferLen, dsf2flac_float64 scale, dsf2flac_float64 tpdfDitherPeakAmplitude=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read PCM output samples in format sampleType into a buffer of length bufferLen.  <a href="#ad04d2cc2a50accf01944d1b9b1e779b0"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#a7ec8fdd57e1ec3606ead5401f72d4c3c">initLookupTable</a> (const dsf2flac_int32 nCoefs, const dsf2flac_float64 *coefs, const dsf2flac_int32 tzero)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the filter lookup table.  <a href="#a7ec8fdd57e1ec3606ead5401f72d4c3c"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename sampleType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classDsdDecimator.html#ae9c523c441b83fbeacdd2626ebdd5cea">getSamplesInternal</a> (sampleType *buffer, dsf2flac_uint32 bufferLen, dsf2flac_float64 scale, dsf2flac_float64 tpdfDitherPeakAmplitude, bool roundToInt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the actual calculation for the getSamples method. Using the lookup tables FIR calculation is a pretty simple summing operation.  <a href="#ae9c523c441b83fbeacdd2626ebdd5cea"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classDsdDecimator.html" title="The DsdDecimator reads DSD samples from a DsdSampleReader and converts them to PCM samples...">DsdDecimator</a> reads DSD samples from a <a class="el" href="classDsdSampleReader.html" title="Abstract class defining anything which reads dsd samples from something.">DsdSampleReader</a> and converts them to PCM samples. </p>
<p>The <a class="el" href="classDsdDecimator.html" title="The DsdDecimator reads DSD samples from a DsdSampleReader and converts them to PCM samples...">DsdDecimator</a> only supports output sample rates which are multiples of 44.1kHz. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3dd1c51417cfe3824fabe905c9ebaaf4"></a><!-- doxytag: member="DsdDecimator::DsdDecimator" ref="a3dd1c51417cfe3824fabe905c9ebaaf4" args="(DsdSampleReader *reader, dsf2flac_uint32 outputSampleRate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classDsdDecimator.html#a3dd1c51417cfe3824fabe905c9ebaaf4">DsdDecimator::DsdDecimator</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classDsdSampleReader.html">DsdSampleReader</a> *&#160;</td>
          <td class="paramname"><em>reader</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_uint32&#160;</td>
          <td class="paramname"><em>outputSampleRate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class constructor. </p>
<p><a class="el" href="classDsdSampleReader.html" title="Abstract class defining anything which reads dsd samples from something.">DsdSampleReader</a> must be a valid reader. outputSampleRate sets the sampling frequency for the output PCM samples, must be a multiple of 44100. Note that not all output sample rates are supported by default. Most can be easily added by putting an appropriate filter into the filters.cpp file. </p>

</div>
</div>
<a class="anchor" id="a54a6576a455fcc80cf6e564efeaa5c78"></a><!-- doxytag: member="DsdDecimator::~DsdDecimator" ref="a54a6576a455fcc80cf6e564efeaa5c78" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classDsdDecimator.html#a54a6576a455fcc80cf6e564efeaa5c78">DsdDecimator::~DsdDecimator</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class destructor, frees internal buffers and lookup table. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aff626833b1aed5d926d45697fa5267de"></a><!-- doxytag: member="DsdDecimator::getDecimationRatio" ref="aff626833b1aed5d926d45697fa5267de" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_uint32 <a class="el" href="classDsdDecimator.html#aff626833b1aed5d926d45697fa5267de">DsdDecimator::getDecimationRatio</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the decimation ratio: DSD sample rate / PCM sample rate. </p>

</div>
</div>
<a class="anchor" id="a2abbd00ca884cec25b6ff0a75b2b44c7"></a><!-- doxytag: member="DsdDecimator::getErrorMsg" ref="a2abbd00ca884cec25b6ff0a75b2b44c7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classDsdDecimator.html#a2abbd00ca884cec25b6ff0a75b2b44c7">DsdDecimator::getErrorMsg</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a message explaining why the reader is invalid. </p>

</div>
</div>
<a class="anchor" id="a257af5321095b2722ed35722253657c7"></a><!-- doxytag: member="DsdDecimator::getFirstValidSample" ref="a257af5321095b2722ed35722253657c7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_float64 <a class="el" href="classDsdDecimator.html#a257af5321095b2722ed35722253657c7">DsdDecimator::getFirstValidSample</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the position of the first PCM sample that is completely defined. </p>

</div>
</div>
<a class="anchor" id="a04549fd1787ba5c1ffc9ad1b06a44ba5"></a><!-- doxytag: member="DsdDecimator::getLastValidSample" ref="a04549fd1787ba5c1ffc9ad1b06a44ba5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_float64 <a class="el" href="classDsdDecimator.html#a04549fd1787ba5c1ffc9ad1b06a44ba5">DsdDecimator::getLastValidSample</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the position of the last PCM sample that is completely defined. </p>

</div>
</div>
<a class="anchor" id="ae0aa44ed62ef6f7de292a15ff0d08b80"></a><!-- doxytag: member="DsdDecimator::getLength" ref="ae0aa44ed62ef6f7de292a15ff0d08b80" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_int64 <a class="el" href="classDsdDecimator.html#ae0aa44ed62ef6f7de292a15ff0d08b80">DsdDecimator::getLength</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the data length in PCM samples. </p>

</div>
</div>
<a class="anchor" id="adcf732aee99437f833e174b8ea787aac"></a><!-- doxytag: member="DsdDecimator::getNumChannels" ref="adcf732aee99437f833e174b8ea787aac" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_uint32 <a class="el" href="classDsdDecimator.html#adcf732aee99437f833e174b8ea787aac">DsdDecimator::getNumChannels</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the number of channels if audio data. </p>

</div>
</div>
<a class="anchor" id="a18dece3aee46e8fe3263355b4abb8a2b"></a><!-- doxytag: member="DsdDecimator::getOutputSampleRate" ref="a18dece3aee46e8fe3263355b4abb8a2b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_uint32 <a class="el" href="classDsdDecimator.html#a18dece3aee46e8fe3263355b4abb8a2b">DsdDecimator::getOutputSampleRate</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the output sample rate in Hz. </p>

</div>
</div>
<a class="anchor" id="aa550fbc6c01104d80b169c56ded63366"></a><!-- doxytag: member="DsdDecimator::getPosition" ref="aa550fbc6c01104d80b169c56ded63366" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_float64 <a class="el" href="classDsdDecimator.html#aa550fbc6c01104d80b169c56ded63366">DsdDecimator::getPosition</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the current position in PCM samples. </p>

</div>
</div>
<a class="anchor" id="a00cd0797502642d272b8ca75cab0d106"></a><!-- doxytag: member="DsdDecimator::getPositionAsPercent" ref="a00cd0797502642d272b8ca75cab0d106" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_float64 <a class="el" href="classDsdDecimator.html#a00cd0797502642d272b8ca75cab0d106">DsdDecimator::getPositionAsPercent</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the current position as a percent of the total data length. </p>

</div>
</div>
<a class="anchor" id="a340371e374a0f18fd65a49df244008eb"></a><!-- doxytag: member="DsdDecimator::getPositionInSeconds" ref="a340371e374a0f18fd65a49df244008eb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsf2flac_float64 <a class="el" href="classDsdDecimator.html#a340371e374a0f18fd65a49df244008eb">DsdDecimator::getPositionInSeconds</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the current position in seconds. </p>

</div>
</div>
<a class="anchor" id="ad04d2cc2a50accf01944d1b9b1e779b0"></a><!-- doxytag: member="DsdDecimator::getSamples" ref="ad04d2cc2a50accf01944d1b9b1e779b0" args="(sampleType *buffer, dsf2flac_uint32 bufferLen, dsf2flac_float64 scale, dsf2flac_float64 tpdfDitherPeakAmplitude=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename sampleType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classDsdDecimator.html#ad04d2cc2a50accf01944d1b9b1e779b0">DsdDecimator::getSamples</a> </td>
          <td>(</td>
          <td class="paramtype">sampleType *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_uint32&#160;</td>
          <td class="paramname"><em>bufferLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_float64&#160;</td>
          <td class="paramname"><em>scale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_float64&#160;</td>
          <td class="paramname"><em>tpdfDitherPeakAmplitude</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read PCM output samples in format sampleType into a buffer of length bufferLen. </p>
<p>bufferLen must be a multiple of <a class="el" href="classDsdDecimator.html#adcf732aee99437f833e174b8ea787aac" title="Return the number of channels if audio data.">getNumChannels()</a>. Channels are interleaved into the buffer.</p>
<p>You also need to provide a scaling factor. This is particularly important for int sample types. The raw DSD data has peak amplitude +-1.</p>
<p>If you wish to add TPDF dither to the data before quantization then please also provide the peak amplitude.</p>
<p>These sample types are supported:</p>
<p>short int, int, long int, float, double</p>
<p>Others should be very simple to add (just take a look at the templates in the source code). </p>

</div>
</div>
<a class="anchor" id="ae9c523c441b83fbeacdd2626ebdd5cea"></a><!-- doxytag: member="DsdDecimator::getSamplesInternal" ref="ae9c523c441b83fbeacdd2626ebdd5cea" args="(sampleType *buffer, dsf2flac_uint32 bufferLen, dsf2flac_float64 scale, dsf2flac_float64 tpdfDitherPeakAmplitude, bool roundToInt)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename sampleType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classDsdDecimator.html#ae9c523c441b83fbeacdd2626ebdd5cea">DsdDecimator::getSamplesInternal</a> </td>
          <td>(</td>
          <td class="paramtype">sampleType *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_uint32&#160;</td>
          <td class="paramname"><em>bufferLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_float64&#160;</td>
          <td class="paramname"><em>scale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">dsf2flac_float64&#160;</td>
          <td class="paramname"><em>tpdfDitherPeakAmplitude</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>roundToInt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Does the actual calculation for the getSamples method. Using the lookup tables FIR calculation is a pretty simple summing operation. </p>

</div>
</div>
<a class="anchor" id="a7ec8fdd57e1ec3606ead5401f72d4c3c"></a><!-- doxytag: member="DsdDecimator::initLookupTable" ref="a7ec8fdd57e1ec3606ead5401f72d4c3c" args="(const dsf2flac_int32 nCoefs, const dsf2flac_float64 *coefs, const dsf2flac_int32 tzero)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classDsdDecimator.html#a7ec8fdd57e1ec3606ead5401f72d4c3c">DsdDecimator::initLookupTable</a> </td>
          <td>(</td>
          <td class="paramtype">const dsf2flac_int32&#160;</td>
          <td class="paramname"><em>nCoefs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const dsf2flac_float64 *&#160;</td>
          <td class="paramname"><em>coefs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const dsf2flac_int32&#160;</td>
          <td class="paramname"><em>tzero</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes the filter lookup table. </p>

</div>
</div>
<a class="anchor" id="a26dde074bfd44b1f67d6e06c3ef75e91"></a><!-- doxytag: member="DsdDecimator::isValid" ref="a26dde074bfd44b1f67d6e06c3ef75e91" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classDsdDecimator.html#a26dde074bfd44b1f67d6e06c3ef75e91">DsdDecimator::isValid</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return false if the reader is invalid (format/file error for example). </p>

</div>
</div>
<a class="anchor" id="ab372f3f22c9ef19d861274e35bb21b95"></a><!-- doxytag: member="DsdDecimator::step" ref="ab372f3f22c9ef19d861274e35bb21b95" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classDsdDecimator.html#ab372f3f22c9ef19d861274e35bb21b95">DsdDecimator::step</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Steps the decimator forward by 8 DSD samples. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>dsd_decimator.h</li>
<li>dsd_decimator.cpp</li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sun Oct 13 2013 22:00:19 for DSF2FLAC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
